package com.javaclimb.music.Demo;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Test {
    public static List<int[]> solution(int nums[]){
        List<int[]> list=new ArrayList<>();
        int length=nums.length;
        if (length<3){
            System.out.println("元素不足3个无法判断");
            return null;
        }
        int size=0;
        for (int i=0;i<length;i++){
            for (int j=i+1;j<length;j++){
                for (int k=j+1;k<length;k++){
                    if (nums[i]+nums[j]+nums[k]==0){
                            int[] yes={nums[i],nums[j],nums[k]};
                            list.add(yes);
                    }
                }
            }
        }
        return list;
    }

    public static void main(String[] args) {
        Scanner cin=new Scanner(System.in);
        String input1=cin.nextLine();
        String[] str1=input1.split(",");
        int[] array=new int[str1.length];
        for (int i=0;i<str1.length;i++){
            array[i]=Integer.parseInt(str1[i]);
        }
        List<int[]>list=Test.solution(array);
        for (int i=0;i<list.size();i++){
            System.out.println("{"+list.get(i)[0]+","+list.get(i)[1]+","+list.get(i)[2]+"}");
        }
    }

}

